
package com.xg.util.excel;

import org.apache.poi.ss.usermodel.IndexedColors;

public class StyleTemplateStrategyFactory {

    public static CellTemplateStyleStrategy getStrategy(String operationType, int colIndex, int modifiedColIndex) {
        switch (operationType) {
            case "insert":
                return new InsertTemplateStyleStrategy();
            case "delete":
                return new DeleteTemplateStyleStrategy();
            case "update":
                return new UpdateTemplateStyleStrategy(colIndex, modifiedColIndex);
            default:
                return style -> style.setFillForegroundColor(IndexedColors.WHITE.getIndex());
        }
    }
}